package com.oa.ylms.apps.business.goods.impl;

import java.util.List;

import com.oa.ylms.apps.business.goods.IGoodsOrderDetailService;
import com.oa.ylms.apps.dao.goods.IGoodsOrderDetailDao;
import com.oa.ylms.apps.entity.goods.GoodInfoValue;
import com.oa.ylms.apps.entity.goods.GoodOrderDetailValue;
import com.oa.ylms.apps.entity.goods.GoodOrderValue;

public class GoodsOrderDetailServiceImpl implements IGoodsOrderDetailService {
	private IGoodsOrderDetailDao detailDao;
	private GoodOrderDetailValue orderDetail;

	@Override
	public int addOrderDetail(GoodOrderDetailValue orderDetail)
			throws Exception {
		return detailDao.addOrderDetail(orderDetail);

	}

	@Override
	public boolean modifyOrderDetail(GoodOrderDetailValue orderDetail)
			throws Exception {
		return detailDao.modifyOrderDetail(orderDetail);

	}

	public IGoodsOrderDetailDao getDetailDao() {
		return detailDao;
	}

	public void setDetailDao(IGoodsOrderDetailDao detailDao) {
		this.detailDao = detailDao;
	}

	@Override
	public List<GoodOrderDetailValue> queryByOrderId(GoodOrderValue goodOrder)
			throws Exception {
		orderDetail.setGoodOrder(goodOrder);
		return detailDao.queryByOrderId(orderDetail);
	}

	public void setOrderDetail(GoodOrderDetailValue orderDetail) {
		this.orderDetail = orderDetail;
	}

	public GoodOrderDetailValue getOrderDetail() {
		return orderDetail;
	}

	@Override
	public GoodOrderDetailValue queryByOrderIdAndGoodId(GoodInfoValue goodInfo,
			GoodOrderValue goodOrder) throws Exception {
		return detailDao.queryByOrderIdAndGoodId(goodInfo, goodOrder);
	}

}
